<?php

/** Zend_View_Helper_Abstract.php */
require_once 'Zend/View/Helper/Abstract.php';

class Project_View_Helper_Message extends Zend_View_Helper_Abstract
{
    /**
	 * 系统提示信息
	 *
	 * @access      public
	 * @param       string      msg_detail      消息内容
	 * @param       int         msg_type        消息类型， 0消息，1错误，2询问
	 * @param       array       links           可选的链接
	 * @param       boolen      $auto_redirect  是否需要自动跳转

	 * @return      void
	 */

    public function message($msg_detail, $msg_type = 0, $links = array(), $auto_redirect = true)
    {//消息 单位秒
        if (count($links) == 0)
		{
			$links[0]['text'] = '返回上一页';
			$links[0]['href'] = 'javascript:history.go(-1)';
		}
		if(isset($links[0]['flag']) && $links[0]['flag'] == 'login_failed'){
			$this->view->flag = $links[0]['flag'];
		}
		$this->view->ur_here = '系统信息';
		$this->view->msg_detail = $msg_detail;
		$this->view->msg_type = $msg_type;
		$this->view->links = $links;
		$this->view->default_url = $links[0]['href'];
		$this->view->auto_redirect = $auto_redirect;
		echo $this->view->render('extendmessage/message.php');
		exit;
    }
}